package com.silence.gankio.mvvm.viewModel

import android.arch.lifecycle.LiveData
import android.arch.lifecycle.MutableLiveData
import com.silence.gankio.bean.IsoyuBean
import com.silence.gankio.net.IsoyuObjectObserver

class IsoyuVideoViewModel : BaseViewModel() {
    private val videoData by lazy { MutableLiveData<IsoyuBean.DataBean>() }

    fun getVideoData(): LiveData<IsoyuBean.DataBean> = videoData

    fun loadData(showLoadingUI: Boolean) {
        load(showLoadingUI, mIsoyuService.video(), object : IsoyuObjectObserver(this) {
            override fun onSuccess(t: IsoyuBean.DataBean) {
                videoData.value = t
            }
        })
    }
}
